<?php
	require_once dirname(__FILE__) . "/../../includes/config.php";
	require_once PHP_ROOTPATH.'/classes/database.php';
	//création des onglets autre_tests et récupération de la liste des utilisateurs inscrits
	header("Content-Type: text/xml; charset=utf-8");
	echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
	echo "<list>";
	 
	$id_connect=Database::getInstance();
	
	$query_temp = "SELECT DISTINCT(label), id_type_test FROM Type_test WHERE label NOT LIKE 'Pesée' AND label NOT LIKE 'IRM' AND label NOT LIKE 'Test immunologique'
	AND label NOT LIKE 'Séquencage' AND label NOT LIKE 'Génotypage' AND label NOT LIKE 'Test biologique' AND label NOT LIKE 'Test induction' 
	AND label NOT LIKE 'Test comportemental' ORDER BY id_type_test";

	$res_query = pg_query($id_connect , $query_temp) or die(pg_last_error());
	$i=0;
	while ($back = pg_fetch_assoc($res_query)) {
		echo $back["label"];
		echo "<item id=\"" . $i . "\" name=\"" . $back["label"] . "\" />";
		$i++;
	}
	echo "<item id=\"newLabel\" name=\"+\" />";

	//remplissage du select avec la liste des utilisateurs inscrits
	$query2 = pg_query($id_connect,"SELECT DISTINCT (Prenom, Nom) as name FROM Utilisateur WHERE statut!='Visiteur' AND statut!='Collaborateur extérieur'");
	while ($back2 = pg_fetch_assoc($query2)) {
		$temp =str_replace(',',' ',$back2["name"]);
		$temp =str_replace('(','',$temp);
		$temp =str_replace(')','',$temp);
		echo "<item id=\"exp\" name=\"$temp\" />";
	}
	echo "</list>";

?>
